package cn.edu.csust.cvs.management.repository;

import cn.edu.csust.cvs.management.repository.entity.VideoSegmentationEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Auther: snail
 * @Date: 2021/1/22 00:30
 * @Description: 视频切分数据访问对象
 */
@Repository
public interface VideoSegmentationRepository extends JpaRepository<VideoSegmentationEntity, Integer> {

    VideoSegmentationEntity findByVideoId(Integer videoId);

    boolean existsByVideoId(Integer videoId);

    @Modifying
    @Transactional
    void deleteByVideoId(Integer videoId);

}
